<template>
  <div class="distributor-merchandise views-container">
    <div class="wlm-table">
        <div class="wlm-table-header">
            <el-form :model="tableFormatData.paidorder.files" size="small" label-width="85px" class="retail-form" label-position="right">
               <el-form-item label="" class="filter">
                 <el-form-item label="订单编号：" class="search">
                        <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.paidorder.files.no" placeholder="请输入订单编号" style="width:200px;"></el-input>
                    </el-form-item>
                     <el-form-item label="用户昵称：" class="search">
                        <el-input @keyup.enter.native="filesSerch" v-model="tableFormatData.paidorder.files.nickName" placeholder="请输入用户昵称" style="width:200px;"></el-input>
                    </el-form-item>
                      <el-form-item label=" 付款状态：" class="search">
                         <el-select v-model="tableFormatData.paidorder.files.pay_status" placeholder="请选择">
                            <el-option
                              v-for="item in options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                    </el-form-item>
               </el-form-item>
                        <el-form-item label="" class="filter-btns">
                    <el-button type="primary" @click="filesSerch">筛选</el-button>
                    <el-button type="text" @click="filesEmpty">清空筛选条件</el-button>
                </el-form-item>
            </el-form>
        </div>
           <div class="wlm-table-content">
            <el-table :ref="tableFormatData.paidorder.key" :data="tableFormatData.paidorder.tableData" @selection-change="handleSelectionChange" style="width: 100%">
                <el-table-column prop="date" label="用户昵称">
                    <template slot-scope="scope">
                        <div style="display:flex;align-items:center;">
                           <div >
                            <img style="height:50px;width:50px;" :src="scope.row.avatarUrl?scope.row.avatarUrl:''" alt="">
                          </div>
                          <div style="margin-left:10px;">{{scope.row.nickName}}</div>
                        </div>
                    </template>
                </el-table-column>
                 <el-table-column prop="date" label="订单编号">
                    <template slot-scope="scope">
                        <span>{{scope.row.no}}</span>
                    </template>
                </el-table-column>
                   <el-table-column prop="date" label="支付金额">
                    <template slot-scope="scope">
                        <span>{{scope.row.pay_price}}</span>
                    </template>
                </el-table-column>
                 <el-table-column prop="date" label="支付渠道">
                    <template slot-scope="scope">
                          <el-tooltip class="item" effect="dark" :content="sourceType[`${scope.row.source}`]" placement="top">
                                <img height="20" width="20" :src="sourceImg[`${scope.row.source || '--'}`]" alt="">
                            </el-tooltip>
                    </template>
                </el-table-column>
                 <el-table-column prop="date" label="支付状态">
                    <template slot-scope="scope">
                        <span v-if="scope.row.pay_status==10">未付款</span>
                        <span v-if="scope.row.pay_status==20">已付款</span>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="支付方式">
                    <template slot-scope="scope">
                        <span v-if="scope.row.pay_type=='admin'">后台确认支付</span>
                        <span v-if="scope.row.pay_type=='wechat'">微信</span>
                        <span v-if="scope.row.pay_type=='alipay'">支付宝</span>
                        <span v-if="scope.row.pay_type=='balance'">余额</span>
                        <span v-if="scope.row.pay_type=='zero'">零元购</span>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="下单时间">
                    <template slot-scope="scope">
                        <span>{{scope.row.create_time}}</span>
                    </template>
                </el-table-column>
            </el-table>
               <div class="pagination-content flex-row flex-justify-b flex-align-c">
                <el-row class="pagination-btns">
                    <!-- <el-checkbox class="check-all" true-label="1" false-label="0" v-model="tableFormatData.paidorder.files.checkall" @change="toggleSelection">全部</el-checkbox> -->
                </el-row>
                <el-pagination :disabled="!hasTableData" @size-change="listPageChange" @current-change="listPageChange" :current-page.sync="tableFormatData.paidorder.pagination.page" :page-sizes="tableFormatData.paidorder.pagination.pagesizes" :page-size.sync="tableFormatData.paidorder.pagination.list_rows" layout="total, sizes, prev, pager, next, jumper" :total="hasTableData?tableFormatData.paidorder.pagination.total : 0">
                </el-pagination>
            </div>
           </div>
    </div>
  </div>
</template>

<script>
import { DealerApplyOrderLists } from "@/api/application";
import mixins from "@/mixins/mixins";
export default {
  mixins: [mixins.getters("Table")],
  name: "paidorder",
  data() {
    return {
      options:[{
          value: '10',
          label: '未付款'
      },
      {
         value: '20',
          label: '已付款'
      },
      ],
        tableFormatData: {
        current: 'paidorder',
        paidorder: {
          key: 'paidorder',
          api: {
            getList: DealerApplyOrderLists,
            // delList: getDistributorGoods
          },
          tableData: [],
          files: {
            no: '',
            category: '',
            dealer_status: '',
            ids: [],
            checkall: '0',
            Recycle: '0'
          },
         
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    };
  },
  created() {},
  methods: {
   
  }
};
</script>
